package cn.fx.operation._01_sync;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class Producer {

    public static void main(String[] args) throws Exception {
        DefaultMQProducer xxxx = new DefaultMQProducer("xxxx_eeee_group");

        xxxx.setNamesrvAddr("localhost:9876");

        xxxx.start();

        Message message = new Message("xxxx", "word", "你好".getBytes(StandardCharsets.UTF_8));

        System.out.println(xxxx.send(message));

        xxxx.shutdown();
    }
}
